#pragma once
#include "ZControl.h"
#include "support/qrcode/QR_Encode.h"
namespace ZuiLib 
{

class ZQrControl :public ZControl
{
public:
	ZUI_CLASS_NAME("zui.QrControl");

	ZCONTROL_CLASS_DEFINE("QrControl", ZControl);

	ZQrControl();

	void PaintStatusImage(ZRenderer* hDC) ZOVERRIDE;
	void SetText(const char* pstrText) ZOVERRIDE;

	void SetLevel(int level);
	void SetVersion(int version);
	void SetAutoExtent(int autoExtent);
	void SetMaskingNo(int maskingNo);

	void SetAttribute(const char* pstrName, const char* pstrValue) ZOVERRIDE;
private:
	CQR_Encode m_qrEncoder;
	color_t m_color;
	RECT m_inset;
	bool m_needUpdate;
	int m_level;
	int m_version;
	int m_autoExtent;
	int m_maskingNo;
};


}//namespace

